<?php
$params = array(
		'title'=>'',
		'submitter_name'=>'',
		'event_category_id'=>'',
		'status'=>'',
);
//code to populate search data in search form starts here
if(isset($this->params['named']))
{
	$params = am($params,$this->params['named']);
}
//set category when viewing specific category listings.
if(isset($this->params['named']['category']))
{
	$params['event_category_id'] = $this->params['named']['category'];
}

//code to populate search data in search form ends here
$statusOptions = array();
$model = $this->params['models']['0'];

$statusOptions = array(
		Event::PUBLISH => __('Published'),
		Event::UNPUBLISH => __('Unpublished'),
);

echo $form->create($model,array('url'=>array('action'=>'admin_index','search'=>"1"),'class'=>'admin_search'));
echo $form->input('title',array('value'=>$params['title']));

echo $form->input('submitter_name',array('label'=>__('User'),'value'=>$params['submitter_name']));
echo $form->input('event_category_id',array('label'=>__('Category'),'type'=>'select','empty'=>__('All'),'options'=>$categories,'selected'=>$params['event_category_id']));
echo $form->input('status',array('type'=>'select','empty'=>__('All'),'options'=>$statusOptions,'selected'=>$params['status']));
	echo $form->submit(__('Search'));?>
<div class="clear"></div>
</form>
